<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
   <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
          <div class="layui-form-item">
              <label class="layui-form-label">门店编号</label>
              <div class="layui-input-block">
                  <input type="text" id="shopSn" name="shopSn"   autocomplete="off" placeholder="请输入门店编号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">店铺类型</label>
              <div class="layui-input-block">
                  <input type="text" id="shopType" name="shopType"   autocomplete="off" placeholder="请输入店铺类型"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店所有人ID(小程序)</label>
              <div class="layui-input-block">
                  <input type="text" id="userId" name="userId"   autocomplete="off" placeholder="请输入门店所有人ID(小程序)"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店所有人ID(后台)</label>
              <div class="layui-input-block">
                  <input type="text" id="adminUserId" name="adminUserId"   autocomplete="off" placeholder="请输入门店所有人ID(后台)"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label"> 是否自营 1:自营 2:非自营</label>
              <div class="layui-input-block">
                  <input type="text" id="isSelf" name="isSelf"   autocomplete="off" placeholder="请输入 是否自营 1:自营 2:非自营"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店名称</label>
              <div class="layui-input-block">
                  <input type="text" id="shopName" name="shopName"   autocomplete="off" placeholder="请输入门店名称"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">店主</label>
              <div class="layui-input-block">
                  <input type="text" id="shopKeeper" name="shopKeeper"   autocomplete="off" placeholder="请输入店主"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">店主手机号</label>
              <div class="layui-input-block">
                  <input type="text" id="telePhone" name="telePhone"   autocomplete="off" placeholder="请输入店主手机号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">公司名称</label>
              <div class="layui-input-block">
                  <input type="text" id="shopCompany" name="shopCompany"   autocomplete="off" placeholder="请输入公司名称"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店图标</label>
              <div class="layui-input-block">
                  <input type="text" id="shopImg" name="shopImg"   autocomplete="off" placeholder="请输入门店图标"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店电话</label>
              <div class="layui-input-block">
                  <input type="text" id="shopTel" name="shopTel"   autocomplete="off" placeholder="请输入门店电话"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店QQ号</label>
              <div class="layui-input-block">
                  <input type="text" id="shopQq" name="shopQq"   autocomplete="off" placeholder="请输入门店QQ号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店地址</label>
              <div class="layui-input-block">
                  <input type="text" id="shopAddress" name="shopAddress"   autocomplete="off" placeholder="请输入门店地址"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">银行ID</label>
              <div class="layui-input-block">
                  <input type="text" id="bankId" name="bankId"   autocomplete="off" placeholder="请输入银行ID"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">银行卡号</label>
              <div class="layui-input-block">
                  <input type="text" id="bankNo" name="bankNo"   autocomplete="off" placeholder="请输入银行卡号"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">银行卡所有人名称</label>
              <div class="layui-input-block">
                  <input type="text" id="bankSerName" name="bankSerName"   autocomplete="off" placeholder="请输入银行卡所有人名称"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">能否开发票 1 能 2 不能</label>
              <div class="layui-input-block">
                  <input type="text" id="isInvoice" name="isInvoice"   autocomplete="off" placeholder="请输入能否开发票 1 能 2 不能"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">发票说明</label>
              <div class="layui-input-block">
                  <input type="text" id="invoiceRemarks" name="invoiceRemarks"   autocomplete="off" placeholder="请输入发票说明"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">服务营业时间</label>
              <div class="layui-input-block">
                  <input type="text" id="serviceStarttime" name="serviceStarttime"   autocomplete="off" placeholder="请输入服务营业时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">服务打样时间</label>
              <div class="layui-input-block">
                  <input type="text" id="serviceEndTime" name="serviceEndTime"   autocomplete="off" placeholder="请输入服务打样时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店状态 1:营业中 2：休息中</label>
              <div class="layui-input-block">
                  <input type="text" id="shopAtive" name="shopAtive"   autocomplete="off" placeholder="请输入门店状态 1:营业中 2：休息中"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">门店状态 4:已停止 3:拒绝 2：未审核 1:已审核</label>
              <div class="layui-input-block">
                  <input type="text" id="shopStatus" name="shopStatus"   autocomplete="off" placeholder="请输入门店状态 4:已停止 3:拒绝 2：未审核 1:已审核"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">状态说明 一般用于停止和拒绝说明</label>
              <div class="layui-input-block">
                  <input type="text" id="statusDesc" name="statusDesc"   autocomplete="off" placeholder="请输入状态说明 一般用于停止和拒绝说明"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">创建时间</label>
              <div class="layui-input-block">
                  <input type="text" id="createTime" name="createTime"   autocomplete="off" placeholder="请输入创建时间"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">商家钱包</label>
              <div class="layui-input-block">
                  <input type="text" id="shopMoney" name="shopMoney"   autocomplete="off" placeholder="请输入商家钱包"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">冻结金额</label>
              <div class="layui-input-block">
                  <input type="text" id="lockMoney" name="lockMoney"   autocomplete="off" placeholder="请输入冻结金额"
                         class="layui-input">
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>
<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            if(check()===false){
                return;
            }

            var formDate = {
                         shopSn:$("#shopSn").val(),
                         shopType:$("#shopType").val(),
                         userId:$("#userId").val(),
                         adminUserId:$("#adminUserId").val(),
                         isSelf:$("#isSelf").val(),
                         shopName:$("#shopName").val(),
                         shopKeeper:$("#shopKeeper").val(),
                         telePhone:$("#telePhone").val(),
                         shopCompany:$("#shopCompany").val(),
                         shopImg:$("#shopImg").val(),
                         shopTel:$("#shopTel").val(),
                         shopQq:$("#shopQq").val(),
                         shopAddress:$("#shopAddress").val(),
                         bankId:$("#bankId").val(),
                         bankNo:$("#bankNo").val(),
                         bankSerName:$("#bankSerName").val(),
                         isInvoice:$("#isInvoice").val(),
                         invoiceRemarks:$("#invoiceRemarks").val(),
                         serviceStarttime:$("#serviceStarttime").val(),
                         serviceEndTime:$("#serviceEndTime").val(),
                         shopAtive:$("#shopAtive").val(),
                         shopStatus:$("#shopStatus").val(),
                         statusDesc:$("#statusDesc").val(),
                         createTime:$("#createTime").val(),
                         shopMoney:$("#shopMoney").val(),
                           lockMoney:$("#lockMoney").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/admin/shopShops/addShopShops",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 10000) {
                        window.location.href=base+"/shopShops/main.html"
                    } else {

                    }
                }
            });
        })







        function check(){
                   if($("#shopSn").val().length<1){
                       layer.msg("请输入门店编号");
                       return false;
                   }
                   if($("#shopType").val().length<1){
                       layer.msg("请输入店铺类型");
                       return false;
                   }
                   if($("#userId").val().length<1){
                       layer.msg("请输入门店所有人ID(小程序)");
                       return false;
                   }
                   if($("#adminUserId").val().length<1){
                       layer.msg("请输入门店所有人ID(后台)");
                       return false;
                   }
                   if($("#isSelf").val().length<1){
                       layer.msg("请输入 是否自营 1:自营 2:非自营");
                       return false;
                   }
                   if($("#shopName").val().length<1){
                       layer.msg("请输入门店名称");
                       return false;
                   }
                   if($("#shopKeeper").val().length<1){
                       layer.msg("请输入店主");
                       return false;
                   }
                   if($("#telePhone").val().length<1){
                       layer.msg("请输入店主手机号");
                       return false;
                   }
                   if($("#shopCompany").val().length<1){
                       layer.msg("请输入公司名称");
                       return false;
                   }
                   if($("#shopImg").val().length<1){
                       layer.msg("请输入门店图标");
                       return false;
                   }
                   if($("#shopTel").val().length<1){
                       layer.msg("请输入门店电话");
                       return false;
                   }
                   if($("#shopQq").val().length<1){
                       layer.msg("请输入门店QQ号");
                       return false;
                   }
                   if($("#shopAddress").val().length<1){
                       layer.msg("请输入门店地址");
                       return false;
                   }
                   if($("#bankId").val().length<1){
                       layer.msg("请输入银行ID");
                       return false;
                   }
                   if($("#bankNo").val().length<1){
                       layer.msg("请输入银行卡号");
                       return false;
                   }
                   if($("#bankSerName").val().length<1){
                       layer.msg("请输入银行卡所有人名称");
                       return false;
                   }
                   if($("#isInvoice").val().length<1){
                       layer.msg("请输入能否开发票 1 能 2 不能");
                       return false;
                   }
                   if($("#invoiceRemarks").val().length<1){
                       layer.msg("请输入发票说明");
                       return false;
                   }
                   if($("#serviceStarttime").val().length<1){
                       layer.msg("请输入服务营业时间");
                       return false;
                   }
                   if($("#serviceEndTime").val().length<1){
                       layer.msg("请输入服务打样时间");
                       return false;
                   }
                   if($("#shopAtive").val().length<1){
                       layer.msg("请输入门店状态 1:营业中 2：休息中");
                       return false;
                   }
                   if($("#shopStatus").val().length<1){
                       layer.msg("请输入门店状态 4:已停止 3:拒绝 2：未审核 1:已审核");
                       return false;
                   }
                   if($("#statusDesc").val().length<1){
                       layer.msg("请输入状态说明 一般用于停止和拒绝说明");
                       return false;
                   }
                   if($("#createTime").val().length<1){
                       layer.msg("请输入创建时间");
                       return false;
                   }
                   if($("#shopMoney").val().length<1){
                       layer.msg("请输入商家钱包");
                       return false;
                   }
                   if($("#lockMoney").val().length<1){
                       layer.msg("请输入冻结金额");
                       return false;
                   }
        }
    });

</script>
</body>
</html>